Re: [swift-users] Performance critical code in Swift

2016-10-01 Thread Игорь Никитин via swift-users
It's isn't just about storing, but also parsing (I parse big json with yajl, the C json parser) and processing that data. And right, name and location is strings > 2 окт. 2016 г., в 0:24, Jens Persson написал(а): > > There's no reason why writing data to disk should be slower in Swift than in

Re: [swift-users] Performance critical code in Swift

2016-10-01 Thread Jens Persson via swift-users
There's no reason why writing data to disk should be slower in Swift than in C/C++. (For the name and location properties, I assume you want to save Strings, a sequence of characters or something rather than just the value of the UnsafePointer.) On Sat, Oct 1, 2016 at 11:22 PM, Игорь Никитин wro

Re: [swift-users] Performance critical code in Swift

2016-10-01 Thread Игорь Никитин via swift-users
I got it. Thanks for your tips! > 2 окт. 2016 г., в 0:13, Jens Persson написал(а): > > You could write some examples in both C and Swift in order to gain experience > in how to write your Swift code so that it will (probably) run as fast as (or > faster than) your corresponding C code. > > I'

Re: [swift-users] Performance critical code in Swift

2016-10-01 Thread Jens Persson via swift-users
You could write some examples in both C and Swift in order to gain experience in how to write your Swift code so that it will (probably) run as fast as (or faster than) your corresponding C code. I've done this for a number of different performance critical things and it is often possible to get t

Re: [swift-users] Performance critical code in Swift

2016-10-01 Thread Игорь Никитин via swift-users
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 let type: Int32 let location: UnsafePointer } SQLite is super slow. I make few millions inserts

Re: [swift-users] Performance critical code in Swift

2016-10-01 Thread Daniel Dunbar via swift-users
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 > wrote: > > Hello!

[swift-users] Performance critical code in Swift

2016-10-01 Thread Игорь Никитин via swift-users
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? ___