I need to write a specialized data storage (database) for some types that are never changes. This struct can be used as an example:
struct User { let id: Int32 let name: UnsafePointer<UInt8> let type: Int32 let location: UnsafePointer<UInt8> } SQLite is super slow. I make few millions inserts and sqlite_step is the problem here (this function takes 15 seconds for all job). So I need to save to the disk few million instances of this struct as fast as possible (this is why I need a custom db) For such of tasks C (or maybe C++) is a good choice. But how can Swift do this as fast as C? Of course I need to use low level C I/O api, but there are another things that I need to know? > 1 окт. 2016 г., в 23:33, Daniel Dunbar <daniel_dun...@apple.com> написал(а): > > Yes, it is possible. Exactly how much use of Unsafe style idioms and other > performance-focused "workarounds" it requires depends a lot on the code in > question. Can you say more about your problem area? > > - Daniel > >> On Oct 1, 2016, at 1:30 PM, Игорь Никитин via swift-users >> <swift-users@swift.org> wrote: >> >> Hello! >> Is it possible for Swift to be as fast as C when writing performance >> critical code? Of course if using C Standard Library for instead of >> Foundation (and so on) and getting rid of dynamic dispatch and reference >> types. >> Or I need just to use C? >> _______________________________________________ >> swift-users mailing list >> swift-users@swift.org >> https://lists.swift.org/mailman/listinfo/swift-users >
_______________________________________________ swift-users mailing list swift-users@swift.org https://lists.swift.org/mailman/listinfo/swift-users